<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>用户登录</title>
  <link type="text/css" rel="stylesheet" href="../css/MyCss.css" />
  <link type="text/css" rel="stylesheet" href="../css/login.css" />
  <link type="text/css" rel="stylesheet" href="../css/base.css" />
  <style>
	*{margin:0;padding:0;}
	.register {border:1px solid #e6e6e6; margin: 20px 6px; background: #f6f4f0;}
	.register > .register-top { text-align: center; background: #555; line-height: 30px;}
	.register > .register-top > label {font-size:16px; color:#fff; font-weight:bold;}
	.register-con > form > label {display:block; overflow: hidden; margin: 10px 43px; }
	.register-con > form > label label {float: left; display:block; line-height: 30px;}
	.register-con > form > label label:nth-child(1) {width: 78px;}
	.register-con > form > label label:last-child i {/*background: url(../image/login/sure.png);*/ width:16px; height:16px; margin: 9px;}
	.autologin-text {padding: 0px 37px;}

	.ver_text {width:100px;}

	.button-skyblu, .button-gray {border: 0px; border-radius: 4px; outline: none; color: #fff; background: rgba(0, 191, 255, 0.85); text-align:center; display: block; cursor: pointer;}
	.button-skyblu {width: 150px; height: 32px;  line-height: 32px; }
	.button-skyblu:hover {background: deepskyblue;}
	.button-gray {width: 73px; height: 32px; line-height: 32px; background: #ccc;}
	#button-gray:hover {background: #8e8787;}

  </style>
 </head>
 <body>
	<!--S - infor-nav-->
	<div class="infor-nav">
		<div class="infor-nav-con">
			<!--登录 注册 我的订单 我的个人信息 购物车 -->
			<ul>
				<li>
					<label>您正在登录</label>&nbsp;&nbsp;&nbsp;&nbsp;
					<label>注册</label>
				</li>
				<li></li>
				<li></li>
				<li>
					<label class="my-infor">管理店铺</label>&nbsp;&nbsp;
					<label class="my-order">查看订单</label>&nbsp;&nbsp;
					<label class="my-cart">销售</label>
				</li>
			</ul>
		</div>
	</div>
	<!--E - infor-nav-->

	<!--S - follow-box-->
	<div class="follow-box"></div>
	<!--E - follow-box-->

	<!--S - goods-nav-->
	<div class="goods-nav">
		<div class="goods-nav-con">
			<div class="shop-icon">
				<a href="../index.html"></a>
			</div>
			<div class="shop-nav">
				<ul>
					<li>服装</li>
					<li>日用品</li>
					<li>食品</li>
					<li>电子产品</li>
					<li>高科技</li>
				</ul>
			</div>
			<!--查找-->
			<div class="search" id="search">
				<input type="text" placeholder="请输入要商品关键字" id="search_text">
				<input type="button" value="搜索本站" id="search_button">
				<!--搜索结果显示区-->
				<div class="search_show" id="search_show"></div>
			</div>
		</div>
	</div>
	<!--E - goods-nav-->

	<!-- start body -->
	<div class="body">
		<div class="body_box">
			<!-- start 其他模块 -->
			<div class="others"></div>
			<!-- end 其他模块 -->

			<!-- start login_box 登录模块 -->
			<div class="login_box">
				<div class="register">
					<div class="register-top">
						<label>商户登录</label>
					</div>
					<div class="register-con">
						<form class="login-form" method="post" action="../merchant_login">
							<!-- 用户名 密码 密码确认 店铺名称 电话号码 同意协议 -->
							<label>
								<label>用户名：</label>
								<label><input name="user" required class="input-text userword" type="text" placeholder="请输入用户名"/></label>
								<label><i></i></label>
							</label>
							<label>
								<label>密码：</label>
								<label><input name="password" required class="input-text pass" type="text" placeholder="请输入密码"/></label>
								<label><i></i></label>
							</label>
							<label>
								<label>
									验证码：
								</label>
								<label>
									<input style="display: block; float: left;" name="vercode" required class="input-text ver_text" type="text" placeholder="请输入验证码"/>
									<img title="点击切换验证码" style="margin-left: 6px; cursor: pointer; display: block; float: left;" class="verimg" src="" height="31px" width="89px"/>
								</label>
								<label><i></i></label>
							</label>
							<label>
								<label class="autologin-text" style="width: 84px; line-height:13px;">
									自动登录
								</label>
								<label class="autologin-check">
									<input name="agree" style="display:block;" type="checkbox" />
								</label>
							</label>
							<label>
								<label>
									<input type="reset" id="button-gray" class="button-gray" value="清除"/>
								</label>
								<label>
									<input type="submit" class="button-skyblu" value="注册"/>
								</label>
							</label>
						</form>
					</div>
				</div>
			</div>
			<!-- end login_box -->
			
		</div>
	</div>
	<!-- body end -->

	<!-- start bom -->
	<div class="bom">
		<div class="bom_container">
			<li style="color:#586069;list-style:none;padding:10px 245px;">Copyright ©2017 <span  style="color:#a71d5d;cursor:pointer;" title="作者介绍">chen</span> Powered By <span  style="color:#a71d5d;cursor:pointer;" title="程序目录">Login</span> Version 1.0.0</li>
		</div>
	</div>
	<!-- bom end -->
	<script src="../js/MyjsV0-8.js"></script>
	<script>
		var VERCODE ;

		//登录表单异步
		$$.formAjax({
			formEle:$(".login-form")[0],
			success:function(msg){
				self.location = "fonts/merchantIndex.html" ;
			},error:function(msg){
				console.log(msg) ;
			}
		}) ;
			
		/*表单验证*/
		$$.formVerifi({
			data:{"userword":"definStrategy","pass":"definStrategy","ver_text":"verCodeStrategy"},
			definStrategy:function(ele){
				console.log("result:"+ele) ;
				if(ele.value.length >= 6)
					ele.parent("label").parent("label").$("i")[0].css("background: url('"+pictureData.trueData+"');", false) ;
				else 
					ele.parent("label").parent("label").$("i")[0].css("background: url('"+pictureData.failData+"');", false) ;
				
			},
			verCodeStrategy:function(ele){
				if(VERCODE == ele.value)
					ele.parent("label").parent("label").$("i")[0].css("background: url('"+pictureData.trueData+"');", false) ;
				else
					ele.parent("label").parent("label").$("i")[0].css("background: url('"+pictureData.failData+"');", false) ;
			}
		}) ;
		//点击清除按钮
		$(".button-gray")[0].onclick = function(){
			tempInput = null ;
			var is = $(".register-con")[0].$("i") ;
			var len = is.length ;
			setTimeout(function(){
				for(var i = 0; i < len; i ++){
					is[i].css("background: none;", false) ;
				}
			}, 100) ;
		}

		
		//获取验证码
		getVerPi();
		function getVerPi(){
			ajax({
				type:"post",
				url:"../merchantVer",
				success:function(msg){
					var a=msg.split("-*-") ;
					//设置src base64
					$(".verimg")[0].src = a[0] ;
					//设置验证码的值
					VERCODE = a[1] ;
					console.log(VERCODE) ;
				}
			})
		}
		

		//获取后天验证码
		function setCode(code){
			VERCODE = code ;
		}

		$(".verimg")[0].onclick=function(){
			getVerPi();
		}
		//获取登录状态
		//getLoginState();
		function getLoginState(){
			ajax({
				type:"post",
				url:"GetLoginState",
				success:function(msg){
					if(msg.indexOf("param1")!=-1){
						console.log("用户名密码不能为空");
					}else if(msg.indexOf("param3")!=-1){
						console.log("当前用户名未注册请前往注册");
					}else if(msg.indexOf("param4")!=-1){
						console.log("该账号已在别地登录") ;
					}else{
						console.log("无登录信息") ;
					}
				}
			})
		}

		
	</script>
 </body>
</html>